<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="com.java.service.*,java.util.*,com.java.model.UserSession,com.java.util.*"%>
<jsp:include page="common/header.jsp"></jsp:include>
<%
	HashMap map			= new HashMap();
	ArrayList list 		= null;
	String poi_cd[] 	= request.getParameterValues("poi_cd");
	String kisu_id[] 	= request.getParameterValues("kisu_id");
	String ent_id[] 	= request.getParameterValues("ent_id");
	String member_id[] 	= request.getParameterValues("member_id");
	String app_chk[]	= request.getParameterValues("app_chk");
	String cancel_chk[] = request.getParameterValues("cancel_chk");
	String user_id[] 	= request.getParameterValues("user_id");
	String checkbox[] 	= request.getParameterValues("checkbox");
	
	String poi_cd1[] 	= new String[checkbox.length];
	String kisu_id1[] 	= new String[checkbox.length];
	String ent_id1[] 	= new String[checkbox.length];
	String member_id1[] = new String[checkbox.length];
	String app_chk1[]	= new String[checkbox.length];
	String cancel_chk1[]= new String[checkbox.length];
	String user_id1[] 	= new String[checkbox.length];
	
	//체크된 항목의 값만 update해주기 위함
	for(int i =0 ; i < checkbox.length; i++){
		poi_cd1[i] 		= poi_cd[Integer.parseInt(checkbox[i])];
		kisu_id1[i] 	= kisu_id[Integer.parseInt(checkbox[i])];
		ent_id1[i] 		= ent_id[Integer.parseInt(checkbox[i])];
		member_id1[i] 	= member_id[Integer.parseInt(checkbox[i])];
		app_chk1[i] 	= app_chk[Integer.parseInt(checkbox[i])];
		cancel_chk1[i] 	= cancel_chk[Integer.parseInt(checkbox[i])];
		user_id1[i] 	= user_id[Integer.parseInt(checkbox[i])];
		
		System.out.println("넘겨온값 =====>" + " poi_cd===>"+poi_cd[Integer.parseInt(checkbox[i])]+ " kisu_id===>" + kisu_id[Integer.parseInt(checkbox[i])]+ " member_id===>" + member_id[Integer.parseInt(checkbox[i])]+ " app_chk===>" + app_chk[Integer.parseInt(checkbox[i])]+ " cancel_chk===>" + cancel_chk[Integer.parseInt(checkbox[i])]);
	}
	
	CommonDaoService commonservice = new CommonDaoService("Com0102lp01UpdateDao");
	map.put("poi_cd",poi_cd1);
	map.put("kisu_id",kisu_id1);
	map.put("ent_id",ent_id1);
	map.put("member_id",member_id1);
	map.put("app_chk",app_chk1);
	map.put("cancel_chk",cancel_chk1);
	map.put("user_id",user_id1);
	
	list = (ArrayList)commonservice.commonDaoMethod(map);
	
	String result_Message = "";
	if(list != null){
		if(list.size() > 0){
			result_Message = (String)list.get(0);
		}
	}

%>
<script>
	<%if(list != null){%>
		alert('<%=result_Message%>');
		parent.location.reload();
	<%}%>
</script>
<body>

</body>
</html>